package com.pushtalk;

import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.pushtalk.utils.ConfigUtil;

public class Config {
	
	protected static final Logger LOG = LoggerFactory.getLogger(Config.class);
	
	//监听间隔时间，默认60秒拉取一次
	public static int ListenInterval = 6;
	//推送间隔，默认60秒推送一次
	public static int PushInterval = 6;
	
	public static String RunningEnvironment;
	public static String PushMode;
	public static String PushAccountUserName;
	public static String PushAccountPassword;
	public static String PushGetUrlDebug;
	public static String PushGetUrlTest;
	public static String PushGetUrlPro;
	public static String PushPostUrlDebug;
	public static String PushPostUrlTest;
	public static String PushPostUrlPro;
	public static String EKPCharset;
	public static String EKPSSOAPITest;
	public static String EKPSSOAPIPro;
	public static String ClearDataByInit;
	public static String ImHostDebug;
	public static String ImHostTest;
	public static String ImHostPro;
	public static String JIDDebug;
	public static String JIDTest;
	public static String JIDPro;
	public static String XmppPort;
	public static String XmppSSLPort;
	public static String StopPushService;
	
	
	public static void initConfig(){
		try {
			Properties properties = ConfigUtil.getProperties();
			RunningEnvironment = properties.getProperty("RunningEnvironment").trim();
			PushMode = properties.getProperty("PushMode").trim();
			PushAccountUserName = properties.getProperty("PushAccountUserName").trim();
			PushAccountPassword = properties.getProperty("PushAccountPassword").trim();
			PushGetUrlDebug = properties.getProperty("PushGetUrlDebug").trim();
			PushGetUrlTest = properties.getProperty("PushGetUrlTest").trim();
			PushGetUrlPro = properties.getProperty("PushGetUrlPro").trim();
			PushPostUrlDebug = properties.getProperty("PushPostUrlDebug").trim();
			PushPostUrlTest = properties.getProperty("PushPostUrlTest").trim();
			PushPostUrlPro = properties.getProperty("PushPostUrlPro").trim();
			EKPCharset = properties.getProperty("EKPCharset").trim();
			EKPSSOAPITest = properties.getProperty("EKPSSOAPITest").trim();
			EKPSSOAPIPro = properties.getProperty("EKPSSOAPIPro").trim();
			ClearDataByInit = properties.getProperty("ClearDataByInit").trim();
			ImHostDebug = properties.getProperty("ImHostDebug").trim();
			ImHostTest = properties.getProperty("ImHostTest").trim();
			ImHostPro = properties.getProperty("ImHostPro").trim();
			JIDDebug = properties.getProperty("JIDDebug").trim();
			JIDTest = properties.getProperty("JIDTest").trim();
			JIDPro = properties.getProperty("JIDPro").trim();
			XmppPort = properties.getProperty("XmppPort").trim();
			XmppSSLPort = properties.getProperty("XmppSSLPort").trim();
			StopPushService = properties.getProperty("StopPushService").trim();

			
		} catch (FileNotFoundException e) {
			LOG.error(e.getMessage());
			e.printStackTrace();
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			LOG.error(e.getMessage());
		}	
		
	}
}
